var OrderAvailableCount = function () {
  var template = /* html */ `
    <div class="order-available-count" v-loading.fullscreen.lock="loading">
      <el-table fit stripe border :data="availableCountList">
        <el-table-column :resizable="false" prop="availableCount" label="占用数" min-width="100px" align="center"></el-table-column>
        <el-table-column prop="materialName" label="物料名称" min-width="120px" header-align="center"></el-table-column>
        <el-table-column prop="providerName" label="供应商" min-width="120px" header-align="center"></el-table-column>
        <el-table-column prop="color" label="编号" min-width="120px" header-align="center"></el-table-column>
        <el-table-column prop="model" label="规格" min-width="120px" header-align="center"></el-table-column>
        <el-table-column prop="companyOrderId" label="订单编号" min-width="140px" header-align="center"></el-table-column>
        <el-table-column prop="factoryNo" label="工厂型号" min-width="120px" header-align="center"></el-table-column>
        <el-table-column prop="customerNo" label="客户型号" min-width="120px" header-align="center"></el-table-column>
        <el-table-column prop="orderId" label="系统订单编号" min-width="140px" header-align="center"></el-table-column>
      </el-table>
    </div>
  `;

  return {
    props: {
      warehouse: {
        type: Object,
        required: true
      }
    },

    data: function () {
      return {
        loading:false,
        availableCountList:[]
      };
    },

    created:function(){
      this.setAvailableCountList();
    },

    methods:{
      setAvailableCountList:function(){
        var warehouse = this.warehouse;
        this.loading = true;
        var self = this;
        ajaxRequest("companyMaterialCount/getAvailableCountByFeedData",{
          materialCode:warehouse.materialCode
        }).then(function(availableCountList){
          self.loading = false;
          self.availableCountList = availableCountList;
        }).catch(function(){
          self.loading = false;
        });
      }
    },

    template: template
  };
}();